<?php
/*
 * Author :basanas & pandiam
 */
   session_start();
?>

<?php
    if(isset($_SESSION['Admin']) && $_SESSION['Admin']!=-1 ){
?>
    
    <div class="block blockBlue" style="margin-bottom:5px;">
        <h2>Administrator Panel</h2>
        <h2>User Management</h2>
        <a href='javascript:chooseCategory("enab")'>Enable User</a><br />
        <a href='javascript:chooseCategory("disab")'>Disable User</a><br />
        <br />
        <h2>Category Management</h2>
        <a href='javascript:chooseCategory("allCats")'>Show All Categories</a><br />
        <a href='javascript:chooseCategory("deleteCats")'>Delete Categories</a><br />
        <a href='javascript:chooseCategory("pend")'>Activate Pending Categories</a><br />
        <a href='javascript:chooseCategory("rest")'>Restore Categories</a><br />
    </div>
<?php
    }
?>

<div class="block blockBlue">
    <h2>Personal Info</h2>
    <a href="profile.php?page=edit">Edit Personal Info</a><br/>
    <br/>
    <h2>Category Management</h2>
    <a href='javascript:chooseCategory("catAdd")'>Create Categories</a><br />
    <a href='javascript:chooseCategory("catEdit")'>Edit Categories</a><br />
    <a href='javascript:chooseCategory("catDelete")'>Delete Categories</a><br />
    <br/>
    <h2>Entities Management</h2>
    <a href='javascript:chooseCategory("add")'>Add Entities</a><br />
    <a href='javascript:chooseCategory("edit")'>Edit Entities</a><br />
    <a href='javascript:chooseCategory("delete")'>Delete Entities</a><br />
</div>


<script type="text/javascript">
var ajax_load = "<img src='images/load.gif' alt='loading...' />";
function chooseCategory(argument){
    if ( argument == "catAdd")
    {
        var loadUrl2 ="createCategory.php";
        $("#profileSideBar").click($("#content").html(ajax_load).load(loadUrl2));
    }
    else
    {
        var loadUrl2 ="myCategories.php?op="+argument;
        $("#profileSideBar").click($("#content").html(ajax_load).load(loadUrl2));
    }
}
</script>